package com.jintian.smart.kernel.switching.entity;

import com.jintian.smart.kernel.orm.entity.annotation.JSONMapper;
import lombok.Data;
import org.beetl.sql.annotation.entity.AssignID;
import org.beetl.sql.annotation.entity.Column;
import org.beetl.sql.annotation.entity.Table;

import java.time.LocalDateTime;
import java.util.Map;

@Data
@Table(name = "mda_etl_extractjob", comment = "交换采集任务表")
public class ETLExtractJob {
    public enum Status {
        waiting, error, succeed, finish;
    }

    /**
     * 任务ID
     */
    @AssignID("snowid")
    private String id;
    /**
     * 任务状态
     */
    private String status;
    /**
     * 创建时间
     */
    @Column(name = "createTime")
    private LocalDateTime createTime;
    /**
     * 执行时间
     */
    @Column(name = "executeTime")
    private LocalDateTime executeTime;
    /**
     * 响应时间
     */
    @Column(name = "responseTime")
    private LocalDateTime responseTime;
    /**
     * 响应状态
     */
    @Column(name = "responseStatus")
    private String responseStatus;

    /**
     * 变量，json结构
     */
    @JSONMapper
    private Map<String, Object> variables;

    /**
     * 数据类型
     */
    @Column(name = "dataType")
    private String dataType;
    /**
     * 规则名称
     */
    @Column(name = "ruleName")
    private String ruleName;

    /**
     * 输出资源
     */
    @Column(name = "outputResource")
    private String outputResource;

    /**
     * 异常
     */
    private String exception;

    private Integer retries;
}
